package com.ouss.tabs;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.Window;
import android.widget.TextView;

public class FormActivity extends FragmentActivity {
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
		setContentView(R.layout.main_form);
		getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE,
				R.layout.title_bar);
		TextView title = (TextView) findViewById(R.id.titlebar);
		Bundle bundle = getIntent().getExtras();
		title.setText(bundle.getString("ViewName"));
		
		OptionsTab tab1 = (OptionsTab) bundle.getSerializable("Tab1");
		
		if (savedInstanceState == null) {
			getSupportFragmentManager().beginTransaction()
					.replace(R.id.placeholder, new DynamicFragment(tab1)).commit();
		}
	}

}
